package com.newsproject.mapper;

import java.util.ArrayList;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.newsproject.pojo.Category;
import com.newsproject.pojo.Post;
import com.newsproject.pojo.User;

@Mapper
public interface SearchInUserPageMapper {
    //搜索自己的新闻
    public ArrayList<Post> searchMyNews(@Param("user_id")int user_id,
                                        @Param("title")String title,
                                        @Param("start_time")String start_time,
                                        @Param("end_time")String end_time,
                                        @Param("type") int type, 
                                        @Param("status")int status,
                                        @Param("startIndex")int startIndex,
                                        @Param("pageSize")int pageSize);

    public ArrayList<Post> searchMyBookmarks(@Param("user_id")int user_id,
                                        @Param("title")String title,
                                        @Param("start_time")String start_time,
                                        @Param("end_time")String end_time,
                                        @Param("status")int status,
                                        @Param("startIndex")int startIndex,
                                        @Param("pageSize")int pageSize);

    //检查用户ID是否存在
    public User checkUser(@Param("user_id")int user_id);

    //检查分类ID是否存在
    public Category checkCategory(@Param("category_id")int category_id);
}
